<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="description" content="Dataset in HTML">
  
  <title>Dataset in HTML</title>
</head>

<body>
<p data-name='Jim' data-nick-name='Jimmy' data-gender='female' myname='Cannot access'>I am Jim</p>

<script>
  var p = document.querySelector('p');
  console.log(p.dataset.name);     // Jim
  console.log(p.dataset.nickName); // Jimmy
  console.log(p.dataset.gender);   // female
  console.log(p.dataset);          // DOMStringMap {name: "Jim", nickName: "Jimmy", gender: "female"}
  console.log(p.myname);           // undefined
</script>
</body>
</html>
